home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-05-01 | 769 b | 55 lines | [TEXT/KAHL] |
- char *p;
- int procs[3];
-
- main()
- {
- int i;
- char s[30];
- int x, *xp;
-
- display("Display Test 1\n");
- display("Display Test %i\n", 2);
- display("Display Test %s\n", "Three");
- display("DT %05i\n",4);
- display("DT >%5i\n",5);
- sprintf(s, "%s %i", "Test String Arg", 67);
- printf("DT %s, %-4d.\n", s, 67);
-
- procs[0] = silly;
- procs[1] = not_silly;
- procs[2] = puts;
- strcpy(s,"H");
- puts("Testing");
- x = 4;
- change_int(&x);
- puts("x:");
- puts(itoa(x));
- puts(itoa(p[0]));
- puts(itoa(p[1]));
- puts(p);
- if (p[0]) puts("P[0] isn't zero");
-
- for (i=4;i<6;i++)
- (procs[i-4])(i);
- (procs[2])("All done");
- }
-
- change_int(int *x)
- {
- *x = 0x43454700;
- p=x;
- }
-
- silly(int x)
- {
- int i;
- for (i=0;i<x;i++) {
- puts("Silly");
- }
- }
-
- not_silly(int x)
- {
- puts("Not Silly");
- puts(itoa(x*x));
- }